/**
 * 
 */
package utility.io;

import java.util.Hashtable;

/**
 * @author Louis
 *
 */
public class HWCharacterIOFactory {
	private static final String OUTPUT_ROOT = "outputs";
	private static HWCharacterIOFactory instance = null;
	
	private Hashtable<String,HWCharacterIO> ios = new Hashtable<String,HWCharacterIO>();
	
	public static HWCharacterIOFactory getInstance(){
		if(instance == null)
			instance = new HWCharacterIOFactory();
		return instance;
	}
	
	private HWCharacterIOFactory(){
		register(new XMLHWCharacterIO(OUTPUT_ROOT));
	}
	
	private void register(HWCharacterIO io){
		ios.put(io.getFormat(), io);
	}
	
	public HWCharacterIO getHWCharacterIO(String type){
		return ios.get(type);
	}
}